﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace ConsoleApp1
{
    class Program
    {
        static void Main(string[] args)
        {
            int[] a = { 1, 2, 3, 4, 5 };

            for (int i = 0; i < a.Length; i++)
            {
                Console.WriteLine(a[i]);
            }

            for(int i = a.Length-1; i >= 0; i--)
            {
                Console.WriteLine(a[i]);
            }

            int max = a[0];
            int min = a[0];
            for (int i = 1; i < a.Length; i++)
            {
                if (a[i] > max)
                {
                    max = a[i];
                }
                if (a[i] < min)
                {
                    min = a[i];
                }
            }
            Console.WriteLine("数组中最大值为：" + max);
            Console.WriteLine("数组中最小值为：" + min);


        }
    }
}
